package org.itheima.pojo;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import net.minidev.json.annotate.JsonIgnore;

import java.time.LocalDateTime;


@Data
@NoArgsConstructor
public class User {
    @NonNull
    private Integer id;//主键ID

    private String username;//用户名

    @JsonIgnore  //忽略password
    private String password;//密码

    @NotEmpty
    @Pattern(regexp = "^\\S{1,10}$")
    private String nickname;//昵称

    @NotEmpty
    @Email
    private String email;//邮箱
    private String userPic;//用户头像地址
    private LocalDateTime createTime;//创建时间
    private LocalDateTime updateTime;//更新时间
    private String personalIntroduction;//个人介绍
    private boolean role;//真就是管理员，假就是用户
    private int status;//什么状态，正常还是封禁
}
